From: Florian Müllner Date: Fri, 4 Mar 2011 00:08:59 +0000 (+0100) Subject: workspace: Move close button to the left in RTL locales X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8786 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cf854778643028fdfa2b441076488f6ce7ee3590;p=gnome-shell.git workspace: Move close button to the left in RTL locales Mutter reverses the button layout in RTL locales, so we should do the same for the window previews' close buttons. https://bugzilla.gnome.org/show_bug.cgi?id=643834 --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 5babb01eb..d75794f8a 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -419,8 +419,13 @@ WindowOverlay.prototype = { let button = this.closeButton; let title = this.title; - let buttonX = cloneX + cloneWidth - button._overlap; - let buttonY = cloneY - button.height + button._overlap; + let buttonX; + let buttonY = cloneY - (button.height - button._overlap); + if (St.Widget.get_default_direction() == St.TextDirection.RTL) + buttonX = cloneX - (button.width - button._overlap); + else + buttonX = cloneX + (cloneWidth - button._overlap); + button.set_position(Math.floor(buttonX), Math.floor(buttonY)); if (!title.fullWidth)